package Strategy_Pattern.Password;

import java.util.Scanner;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class Client {
    public static void main(String[] args) {
        Add_password addPassword=new Add_password();
        Scanner input=new Scanner(System.in);
        Password pd;
        String id,password;
        int chance;
        System.out.println("输入id");
        id=input.next();
        addPassword.setId(id);
        System.out.println("输入密码");
        password=input.next();
        addPassword.setPassword(password);
        System.out.println("凯撒加密输入1，求模加密输入2");
        chance=input.nextInt();
        if(chance==1){
            pd=new One_password();
            addPassword.setPd(pd);
            System.out.println(addPassword.play());
        }
        else if(chance==2){
            pd=new Two_password();
            addPassword.setPd(pd);
            System.out.println(addPassword.play());
        }
        else{
            System.out.println("选择无效");
        }

    }
}
